﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;
using System.Data.OracleClient;
using System.Data;

namespace MySoftWare.DataAccess.DBProvider
{
    public class OracleProvider : IDbProvider
    {

        public void DeriveParameters(IDbCommand cmd)
        {
            if ((cmd as OracleCommand) != null)
            {
                OracleCommandBuilder.DeriveParameters(cmd as OracleCommand);
            }
        }

        public DbProviderFactory GetInstance()
        {
            return OracleClientFactory.Instance;
        }

        public DbParameter MakeParam(string ParamName, DbType DbType, int Size)
        {
            OracleParameter param;
            if (Size > 0)
                param = new OracleParameter(ParamName, (OracleType)DbType, Size);
            else
                param = new OracleParameter(ParamName, (OracleType)DbType);
            return param;
        }

        public bool IsFullTextSearchEnabled()
        {
            return true;
        }

        public bool IsCompactDatabase()
        {
            return true;
        }

        public bool IsBackupDatabase()
        {
            return true;
        }
    }
}
